import { IBzPluginIframeWrapper } from "./ibz-plugin-iframe-wrapper";

/**
 * iframe实例内置控制器
 *
 * @export
 * @class IBzPluginIframeController
 */
export class IBzPluginIframeController {
    /**
     * 当前对象
     *
     * @type {IBzPluginIframeWrapper}
     * @memberof IBzPluginIframeController
     */
    element: IBzPluginIframeWrapper;

    /**
     * Creates an instance of IBzPluginIframeController.
     * @param {IBzPluginIframeWrapper} instance
     * @memberof IBzPluginIframeController
     */
    constructor(instance: IBzPluginIframeWrapper) {
        this.element = instance;
    }

    /**
     * 隐藏
     *
     * @memberof IBzPluginIframeController
     */
    hidden(): void {
        this.element.hiddenIframe.emit();
    }

    /**
     * 关闭
     *
     * @memberof IBzPluginIframeController
     */
    close(): void {
        this.element.closeIframe.emit();
    }
}
